﻿///****************************************************************************
//**		File: WechatUtils.cs
//** 		Desc: 微信
//** 		Called by:
//**
//** 		Auth: 陈泳江 （chenyongjiang@sxt.com.cn）
//** 		Date: 2014/5/8 14:12:47
//** ===========================================================================
//** 		Change History
//** ===========================================================================
//** 		Date:		Author:				Description:
//** 		--------	--------			-------------------
//**
//** ===========================================================================
//** Copyright (C) 2004-2011 SXT Corporation
//******************************************************************************/
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Web;
//using System.Data;
//using System.Data.SqlClient;
//using SXT.DB;
//using System.IO;
//using System.Text;
//using SXT.Data;

//namespace ZHDJ.MobileInterface.Common
//{
//    public class WechatUtils
//    {
//        #region 流动党员找组织
//        public static string FBranch(FormField ff)
//        {
//            string branchUser = GetBranchLeader(ff.BranchID);
//            ff.ID = StringHelper.NewID;
//            ff.Status = "提交申请";
//            if (!string.IsNullOrEmpty(ff.Birthday))
//            {
//                ff.Age = (DateTime.Now.Year - Convert.ToDateTime(ff.Birthday).Year).ToString();
//            }
//            ff.Insert();
//            //待办
//            SXT.Party.Utility.PartyTask.AddTask(ff.ID, ff.UserName + "申请",
//                "流动党员找组织", "",
//                new String[] { branchUser },
//                "../../../BranchCenter/Module/FlowPartyMembers/PartyMembersFindOrgApproval.aspx?RelationID=" + ff.ID, "Member");
            
//            return "";
//        }
        
//        public static string GetBranchLeader(string branchID)
//        {
//            using (SqlCommand cmd = new SqlCommand())
//            {
//                string sql = "";
//                if (!string.IsNullOrEmpty(branchID))
//                {
//                    sql = string.Format(@" select LoginID from tblPartyOrgMembers where BranchID=@BranchID and IsPartyWorker=1 ", branchID);
//                    cmd.Parameters.Add("@BranchID", SqlDbType.VarChar).Value = string.Format("{0}", branchID);
//                }
//                else
//                {
//                    sql = @"SELECT om.LoginID FROM dbo.tblPartyOrgMembers om 
//                        INNER JOIN dbo.tblPartyOrgBranch ob ON om.BranchID = ob.BranchID
//                        WHERE ISNULL(ob.ParentBranchID, '') = '' AND om.IsPartyWorker = 1";
//                }
//                cmd.CommandText = sql;
//                object o = DBManager.DefaultDB.ExecuteScalar(cmd);
//                return o != null ? o.ToString() : "";
//            }
//        }
//        #endregion
//    }

//    public class FormField : DataModel
//    {
//        #region 字段属性
//        /// <summary>
//        /// 登记ID
//        /// </summary>
//        public string ID { get; set; }

//        /// <summary>
//        /// 用户名
//        /// </summary>
//        public string UserName { get; set; }

//        /// <summary>
//        /// 性别
//        /// </summary>
//        public string Sex { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string Birthday { get; set; }

//        /// <summary>
//        /// 部门名称
//        /// </summary>
//        public string Age { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string QQ { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string Address { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string Street { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string NativePlace { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string Nation { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string Educational { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string Title { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string JoinPartyDate { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string WorkDate { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string PartyAddress { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string PartyCardNo { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string ContactWay { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string Description { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string BranchID { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string CreateBy { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public DateTime? CreateTime { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string IDCard { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string MobileNumber { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string Status { get; set; }

//        /// <summary>
//        /// 
//        /// </summary>
//        public string PartyJobAdderss { get; set; }
//        #endregion
//    }
//}